package io.gitee.hchaojie.day03;

public class Employee {
    public Employee() {
        System.out.println("这是父类的构造器。。。");
    }

    public Employee(String name) {
        this.name = name;
    }

    public void work() {
        System.out.println("employee work..");
    }

    private String name;
    private double salary;

    // 组合关系（has-a）
    protected Department department;

    public String getName() {
        return this.name;
    }
}

class Department {
    private String name;
    private String no;
    private Employee manager;

}

class Programmer extends Employee {
    public Programmer() {
        System.out.println("这是子类的构造器。。。");
    }

    public Programmer(String name) {
        super(name);
    }

    public String getName() {
        return super.getName();
    }
    
    public void work() {
        System.out.println("写bug。。。");
    }
    
    public void overwork() {
        System.out.println("我在加班。。。");
    }
}

class Designer extends  Employee {
    public void work() {
        System.out.println("切图。。。");

        System.out.println(this.department);
    }
}
